<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="__UI__/css/bs3/dpl.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/bs3/bui.css" rel="stylesheet" type="text/css" />
<link href="__UI__/css/style.css" rel="stylesheet" type="text/css" />
<link href="__UI__/uploadify/uploadify.css" rel="stylesheet" type="text/css">
<style type="text/css">

#tabbox {
	width:90%;
	overflow:hidden;
	margin:0 auto;
}

.tabs {
	width: 100%;
	height: 32px;
	margin:20px auto;
}

.tabs li {
	float:left;
	height:31px;
	line-height:31px;
	border:1px solid #204077;
	border-left:none;
	margin-bottom: -1px;
	overflow: hidden;
	position: relative;
	border-radius:5px;
	margin:0px 5px;
}

.tabs li a {
	display: block;
	padding: 0 20px;
	background:#428bca;
	color:#fff;
	text-decoration:none;
}

.tabs .thistab a,.tabs .thistab a:hover,.tabs .thistab a:active {
	background:#fff;
	color:#428bca;
	text-decoration:none;
}


.tab_conbox {
	width:98%;
	border: 1px solid #EAEAEA;
	height:auto;
}

.tab_conbox li {
	padding:12px;
	font-size: 14px;
	overflow:hidden;
}

.form-horizontal .controls {
	float:none;
}

.controls .button {
	margin-top:-22px;
	margin-right:20px;
}

.control-group .controls{
	float:none;
	margin-bottom:40px;
}

.controls .con{
	width:85%;
	margin:20px auto 20px 130px;
	height:auto;
	line-height:30px;
	word-wrap: break-word; 
	word-break: normal;
	color:#fff;
}

.controls .cons{
	width:85%;
	margin:-20px auto 20px 140px;
	height:auto;
	min-height:30px;
	line-height:30px;
	word-wrap: break-word; 
	word-break: normal;
	overflow:hidden;
	color:#fff;
}

.hint h4{
	margin:10px auto;
}

.hint ul{
	width:100%;
}

.hint ul li {
	display:inline-block;
	margin:0px 10px 10px 10px;
	height:40px;
	line-height:40px;
	color:#fff;
}

</style>
<script type="text/javascript" src="__UI__/js/jquery-1.8.1.min.js"></script>
</head>
<body>
<script language="javascript">

var winID = null;
function openFullWindow(url,winname){
	var strFeatures = "left=0,screenX=0,top=0,screenY=0";  
	if (window.screen){
		var maxh = screen.availHeight-30;
		var maxw = screen.availWidth-10;
		strFeatures += ",height="+maxh;
		strFeatures += "innerHeight"+maxh;
		strFeatures += ",width="+maxw;
		strFeatures += "innerwidth"+maxw;
	}else{
		strFeatures +=",resizable"; 
	}
	winID = window.open(url,winname,strFeatures);
}

</script>
<div class="demo-content" style="margin-top:1%;">
    <div class="row" style="margin-left:10px;">
		<div style="text-align:center"><h2>{$scripts.scriptsname} - 演练场景</h2><hr></div>
        <div id="tabbox">
			<a class="button button-primary" onClick="window.location.reload();" style="margin-bottom:10px;">刷新本页</a>
            <div class="hint">
            	<h4>操作提示</h4>
                <ul>
                	<li>1、点击选择演练场景</li>
                    <li>2、点击综合演练窗口，显示场景内容</li>
                    <li>3、点击响应部门，进入部门响应</li>
                </ul>
            </div>
            <ul class="tabs" id="tabs">
				<volist name="scene" id="vo" key="k">
				<li <if condition="$k eq I('get.did')">class="active"</if>><a href="{:U('Home/Scripts/scenario', array('did'=>$k,'sid'=>I('get.sid')))}">场景{$k} - {$vo.scenename}</a></li>
				</volist>
			</ul>
            <div class="form-horizontal registerform">
                <ul class="tab_conbox" id="tab_conbox">
                	<volist name="scene" id="vo" key="k">
                    <li class="tab_con">
						<div id="panel" class="" style="padding:10px;">
                            <div class="control-group">
                                <div class="controls">
                                    <label class="control-label"><h3>演练窗口</h3></label>
                                    <div class="controls">
                                        <a class="button button-primary" onclick=openFullWindow('{:U("Home/Drill/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"titles","tid"=>"演练场景"))}#scripts/drill','JS') style="margin-top:-2px;">综合演练窗口</a>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="control-group" style="margin-top:20px;">
                                <div class="controls">
                                    <label class="control-label"><h3>场景{$k}</h3></label>
                                    <div class="controls">
                                    	<div class="cons"><h3>{$vo.scenename}</h3></div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="control-group">
                                <div class="controls">
                                    <label class="control-label"><h3>场景事件</h3></label>
                                    <div class="controls">
                                        <audio controls src='{:U("Home/Scripts/voice",array("sid"=>$vo[id],"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"brief","tid"=>"场景事件"))}'></audio>
									</div>
                                    <div class="controls">
										<div class="con"><pre>{$vo.brief}</pre></div>
									</div>
                                </div>
                            </div>
                            
                            <div class="control-group">
                                <div class="controls">
                                    <label class="control-label"><h3>多媒体文件</h3></label>
                                    <div class="controls">
                                        <volist name="vo['pic']" id="vs">
                                        <div class="con">
                                            <if condition="$vs.ext eq 'jpg' or $vs.ext eq 'png' or $vs.ext eq 'gif'">
                                            <img src="__ROOT__/{$vs.pic}" width="300"/>
                                            </if>
                                            <if condition="$vs.ext eq 'mp4'">
                                            <video id="video1" controls width="420" style="margin-top:15px;">
                                                <source src="__ROOT__/{$vs.pic}" type="video/mp4" />
                                            </video>
                                            </if>
                                        </div>
                                        </volist>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="control-group">
                                <div class="controls">
                                    <label class="control-label"><h3>响应提示</h3></label>
                                    <audio controls src='{:U("Home/Scripts/voice",array("sid"=>$vo[id],"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"hint","tid"=>"响应提示"))}'></audio>
                                    <div class="controls">
                                    <volist name="vo['hint']" id="v" key="a">
                                        <div class="con">
                                        	<pre>{$v}</pre>
                                        </div>
									</volist>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="control-group">
                                <div class="controls">
                                    <label class="control-label"><h3>响应部门</h3></label>
                                    <div class="controls">
									<volist name="vo['department']" id="v" key="b">
										<a class="button button-primary" id="department{$k}{$b}">{$v}</a>
<script type="text/javascript">
	$(function () {       
		$('#department{$k}{$b}').click(function(){
			top.topManager.openPage({
				id:'department{$b}',
				title:'{$v}响应',
				href:'{:U("Home/Scripts/department", array("sid"=>I("get.sid"),"uid"=>session(C("AUTH_KEYS")),"mid"=>session("gid"),"pid"=>I("get.pid"),"hid"=>$vo[id],"did"=>$b,"rid"=>$record[id],"tid"=>$v))}',
			});
		 });
    });
</script>
									</volist>
                                	</div>
                                </div>
							</div>
                            <div class="control-group" style="margin:20px auto;">
                                <div class="controls">
                                    <label class="control-label"><h3>响应操作</h3></label>
                                    <div class="controls">
                                    	<a class="button button-primary" onclick=openFullWindow('{:U("Home/Drill/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"department","tid"=>"演练场景","k"=>"show"))}#scripts/drill','JS') style="margin-top:-2px;">主显示区</a>
                                        <!--<a class="button button-primary" onclick=openFullWindow('{:U("Home/Scripts/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"titles","tid"=>"演练场景"))}#scripts/drill','JS') style="margin-top:-2px;">响应顺序</a>
                                        <a class="button button-primary" onclick=openFullWindow('{:U("Home/Scripts/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"titles","tid"=>"演练场景"))}#scripts/drill','JS') style="margin-top:-2px;">隐藏顺序</a>
                                        <a class="button button-primary" onclick=openFullWindow('{:U("Home/Scripts/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"titles","tid"=>"演练场景"))}#scripts/drill','JS') style="margin-top:-2px;">演练提示</a>
                                        <a class="button button-primary" onclick=openFullWindow('{:U("Home/Scripts/index",array("id"=>$vo[id],"sid"=>I("get.sid"),"pid"=>I("get.pid"),"bid"=>"scene","nid"=>"titles","tid"=>"演练场景"))}#scripts/drill','JS') style="margin-top:-2px;">响应记录</a>-->
                                    </div>
                            	</div>
                            </div>  
						</div>
					</li>
                	</volist>
                </ul>
                <div class="row actions-bar">
                    <div class="form-actions">
                        <a class="button button-primary" id="scenario">结束演练</a>
                        <a class="button button-primary" name="backid" id="backid">取消</a>
                        <span id="msgdemo2"></span>
                    </div>
                </div>
            </div>
            <a class="button button-primary" onClick="window.location.reload();" style="margin-top:10px;">刷新本页</a>
    	</div>
    </div>        	
</div>	
<script type="text/javascript" src="__UI__/js/jquery.SuperSlide.js"></script>
<script type="text/javascript" src="__UI__/js/config.js"></script>
<script type="text/javascript" src="__UI__/js/bui.js"></script>
<script type="text/javascript" src="__UI__/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">

	$(document).ready(function() {
		jQuery.jqtab = function(tabtit,tab_conbox,shijian) {
			$(tab_conbox).find("li").hide();
			$(tabtit).find("li:first").addClass("thistab").show(); 
			$(tab_conbox).find("li:first").show();
		
			$(tabtit).find("li").bind(shijian,function(){
			  $(this).addClass("thistab").siblings("li").removeClass("thistab"); 
				var activeindex = $(tabtit).find("li").index(this);
				$(tab_conbox).children().eq(activeindex).show().siblings().hide();
				return false;
			});
		
		};
		$.jqtab("#tabs", "#tab_conbox", "click");	
	});
	
	BUI.use('bui/form', function (Form) {
        new Form.Form({
            srcNode:'#J_Form'
        }).render();
    });
	
	$(function () {       
		$('#scenario').click(function(){
			top.topManager.openPage({
				id:'result',
				title:'演练总结',
				href:'{:U("Scripts/result",array("sid"=>I("get.sid"),"pid"=>I("get.pid")))}',
				isClose:true,
				reload:true,
			});
		 });
    });
	
</script>
</body>
</html>